package utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author koelio
 *
 */
public class FileLoader {

	List<String> teams = new ArrayList<String>();
	List<String> faculties = new ArrayList<String>();
	List<String> rounds = new ArrayList<String>();

	public FileLoader() {

		try {
			BufferedReader reader = new BufferedReader(new FileReader(new File(
					"files/teams.txt")));

			BufferedReader reader2 = new BufferedReader(new FileReader(
					new File("files/faculties.txt")));

			BufferedReader reader3 = new BufferedReader(new FileReader(
					new File("files/incontri.txt")));

			String line = reader.readLine();
			String line2 = reader2.readLine();
			String line3 = reader3.readLine();

			while (line != null) {
				// System.out.println(line);
				teams.add(line);

				line = reader.readLine();
			}

			while (line2 != null) {
				// System.out.println(line2);

				faculties.add(line2);
				line2 = reader2.readLine();
			}

			while (line3 != null) {
				 //System.out.println("yoooo" + line3);

				rounds.add(line3);
				line3 = reader3.readLine();
			}

			reader.close();
			reader2.close();
			reader3.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	public List<String> getTeams() {
		return teams;
	}

	public List<String> getFaculties() {
		return faculties;
	}

	public List<String> getRounds() {
		return rounds;
	}

}
